home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / digdug.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  21KB  |  569 lines

  1. /***************************************************************************
  2.  
  3. Dig Dug
  4.  
  5. driver by Aaron Giles
  6.  
  7.  
  8. -----------+---+-----------------+-------------------------
  9.    hex     |r/w| D D D D D D D D |
  10.  location  |   | 7 6 5 4 3 2 1 0 | function
  11. -----------+---+-----------------+-------------------------
  12. 0000-3FFF  | R | D D D D D D D D | CPU 1 rom (16k)
  13. 0000-1FFF  | R | D D D D D D D D | CPU 2 rom (8k)
  14. 0000-0FFF  | R | D D D D D D D D | CPU 3 rom (4k)
  15. -----------+---+-----------------+-------------------------
  16. 6800-680F  | W | - - - - D D D D | Audio control
  17. 6810-681F  | W | - - - - D D D D | Audio control
  18. -----------+---+-----------------+-------------------------
  19. 6820       | W | - - - - - - - D | 0 = Reset IRQ1(latched)
  20. 6821       | W | - - - - - - - D | 0 = Reset IRQ2(latched)
  21. 6822       | W | - - - - - - - D | 0 = Reset NMI3(latched)
  22. 6823       | W | - - - - - - - D | 0 = Reset #2,#3 CPU
  23. 6825       | W | - - - - - - - D | custom 53 mode1
  24. 6826       | W | - - - - - - - D | custom 53 mode2
  25. 6827       | W | - - - - - - - D | custom 53 mode3
  26. -----------+---+-----------------+-------------------------
  27. 6830       | W |                 | watchdog reset
  28. -----------+---+-----------------+-------------------------
  29. 7000       |R/W| D D D D D D D D | custom 06 Data
  30. 7100       |R/W| D D D D D D D D | custom 06 Command
  31. -----------+---+-----------------+-------------------------
  32. 8000-87FF  |R/W| D D D D D D D D | 2k playfeild RAM
  33. -----------+---+-----------------+-------------------------
  34. 8B80-8BFF  |R/W| D D D D D D D D | 1k sprite RAM (PIC,COL)
  35. 9380-93FF  |R/W| D D D D D D D D | 1k sprite RAM (VPOS,HPOS)
  36. 9B80-9BFF  |R/W| D D D D D D D D | 1k sprite RAM (FLIP)
  37. -----------+---+-----------------+-------------------------
  38. A000       | W | - - - - - - - D | playfield select
  39. A001       | W | - - - - - - - D | playfield select
  40. A002       | W | - - - - - - - D | Alpha color select
  41. A003       | W | - - - - - - - D | playfield enable
  42. A004       | W | - - - - - - - D | playfield color select
  43. A005       | W | - - - - - - - D | playfield color select
  44. A007       | W | - - - - - - - D | flip video
  45. -----------+---+-----------------+-------------------------
  46. B800-B83F  | W | D D D D D D D D | write EAROM addr,  data
  47. B800       | R | D D D D D D D D | read  EAROM data
  48. B840       | W |         D D D D | write EAROM control
  49. -----------+---+-----------------+-------------------------
  50.  
  51. Dig Dug memory map (preliminary)
  52.  
  53. CPU #1:
  54. 0000-3fff ROM
  55. CPU #2:
  56. 0000-1fff ROM
  57. CPU #3:
  58. 0000-0fff ROM
  59. ALL CPUS:
  60. 8000-83ff Video RAM
  61. 8400-87ff Color RAM
  62. 8b80-8bff sprite code/color
  63. 9380-93ff sprite position
  64. 9b80-9bff sprite control
  65. 8800-9fff RAM
  66.  
  67. read:
  68. 6800-6807 dip switches (only bits 0 and 1 are used - bit 0 is DSW1, bit 1 is DSW2)
  69.           dsw1:
  70.             bit 6-7 lives
  71.             bit 3-5 bonus
  72.             bit 0-2 coins per play
  73.           dsw2: (bootleg version, the original version is slightly different)
  74.             bit 7 cocktail/upright (1 = upright)
  75.             bit 6 ?
  76.             bit 5 RACK TEST
  77.             bit 4 pause (0 = paused, 1 = not paused)
  78.             bit 3 ?
  79.             bit 2 ?
  80.             bit 0-1 difficulty
  81. 7000-     custom IO chip return values
  82. 7100      custom IO chip status ($10 = command executed)
  83.  
  84. write:
  85. 6805      sound voice 1 waveform (nibble)
  86. 6811-6813 sound voice 1 frequency (nibble)
  87. 6815      sound voice 1 volume (nibble)
  88. 680a      sound voice 2 waveform (nibble)
  89. 6816-6818 sound voice 2 frequency (nibble)
  90. 681a      sound voice 2 volume (nibble)
  91. 680f      sound voice 3 waveform (nibble)
  92. 681b-681d sound voice 3 frequency (nibble)
  93. 681f      sound voice 3 volume (nibble)
  94. 6820      cpu #1 irq acknowledge/enable
  95. 6821      cpu #2 irq acknowledge/enable
  96. 6822      cpu #3 nmi acknowledge/enable
  97. 6823      if 0, halt CPU #2 and #3
  98. 6830      Watchdog reset?
  99. 7000-     custom IO chip parameters
  100. 7100      custom IO chip command (see machine/galaga.c for more details)
  101. a000-a002 starfield scroll direction/speed (only bit 0 is significant)
  102. a003-a005 starfield blink?
  103. a007      flip screen
  104.  
  105. Interrupts:
  106. CPU #1 IRQ mode 1
  107.        NMI is triggered by the custom IO chip to signal the CPU to read/write
  108.            parameters
  109. CPU #2 IRQ mode 1
  110. CPU #3 NMI (@120Hz)
  111.  
  112. ***************************************************************************/
  113.  
  114. #include "driver.h"
  115. #include "vidhrdw/generic.h"
  116.  
  117. extern unsigned char *digdug_sharedram;
  118. READ_HANDLER( digdug_hiscore_print_r );
  119. READ_HANDLER( digdug_sharedram_r );
  120. WRITE_HANDLER( digdug_sharedram_w );
  121. WRITE_HANDLER( digdug_interrupt_enable_1_w );
  122. WRITE_HANDLER( digdug_interrupt_enable_2_w );
  123. WRITE_HANDLER( digdug_interrupt_enable_3_w );
  124. WRITE_HANDLER( digdug_halt_w );
  125. READ_HANDLER( digdug_customio_r );
  126. WRITE_HANDLER( digdug_customio_w );
  127. READ_HANDLER( digdug_customio_data_r );
  128. WRITE_HANDLER( digdug_customio_data_w );
  129. int digdug_interrupt_1(void);
  130. int digdug_interrupt_2(void);
  131. int digdug_interrupt_3(void);
  132. void digdig_init_machine(void);
  133.  
  134. WRITE_HANDLER( digdug_flipscreen_w );
  135. extern unsigned char *digdug_vlatches;
  136. WRITE_HANDLER( digdug_cpu_reset_w );
  137. WRITE_HANDLER( digdug_vh_latch_w );
  138. int digdug_vh_start(void);
  139. void digdug_vh_stop(void);
  140. void digdug_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  141. void digdug_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  142.  
  143. WRITE_HANDLER( pengo_sound_w );
  144. extern unsigned char *pengo_soundregs;
  145.  
  146.  
  147.  
  148. static struct MemoryReadAddress readmem_cpu1[] =
  149. {
  150.     { 0x0000, 0x3fff, MRA_ROM },
  151.     { 0x7000, 0x700f, digdug_customio_data_r },
  152.     { 0x7100, 0x7100, digdug_customio_r },
  153.     { 0x8000, 0x9fff, digdug_sharedram_r },
  154.     { -1 }    /* end of table */
  155. };
  156.  
  157. static struct MemoryReadAddress readmem_cpu2[] =
  158. {
  159.     { 0x0000, 0x1fff, MRA_ROM },
  160.     { 0x8000, 0x9fff, digdug_sharedram_r },
  161.     { -1 }    /* end of table */
  162. };
  163.  
  164. static struct MemoryReadAddress readmem_cpu3[] =
  165. {
  166.     { 0x0000, 0x0fff, MRA_ROM },
  167.     { 0x8000, 0x9fff, digdug_sharedram_r },
  168.     { -1 }    /* end of table */
  169. };
  170.  
  171. static struct MemoryWriteAddress writemem_cpu1[] =
  172. {
  173.     { 0x0000, 0x3fff, MWA_ROM },
  174.     { 0x6820, 0x6820, digdug_interrupt_enable_1_w },
  175.     { 0x6821, 0x6821, digdug_interrupt_enable_2_w },
  176.     { 0x6822, 0x6822, digdug_interrupt_enable_3_w },
  177.     { 0x6823, 0x6823, digdug_halt_w },
  178.         { 0xa007, 0xa007, digdug_flipscreen_w },
  179.     { 0x6825, 0x6827, MWA_NOP },
  180.     { 0x6830, 0x6830, watchdog_reset_w },
  181.     { 0x7000, 0x700f, digdug_customio_data_w },
  182.     { 0x7100, 0x7100, digdug_customio_w },
  183.     { 0x8000, 0x9fff, digdug_sharedram_w, &digdug_sharedram },
  184.     { 0x8000, 0x83ff, MWA_RAM, &videoram, &videoram_size },   /* dirtybuffer[] handling is not needed because */
  185.     { 0x8400, 0x87ff, MWA_RAM },                              /* characters are redrawn every frame */
  186.     { 0x8b80, 0x8bff, MWA_RAM, &spriteram, &spriteram_size }, /* these three are here just to initialize */
  187.     { 0x9380, 0x93ff, MWA_RAM, &spriteram_2 },              /* the pointers. The actual writes are */
  188.     { 0x9b80, 0x9bff, MWA_RAM, &spriteram_3 },                /* handled by digdug_sharedram_w() */
  189.     { 0xa000, 0xa00f, digdug_vh_latch_w, &digdug_vlatches },
  190.     { -1 }    /* end of table */
  191. };
  192.  
  193. static struct MemoryWriteAddress writemem_cpu2[] =
  194. {
  195.     { 0x0000, 0x1fff, MWA_ROM },
  196.     { 0x6821, 0x6821, digdug_interrupt_enable_2_w },
  197.     { 0x6830, 0x6830, watchdog_reset_w },
  198.     { 0x8000, 0x9fff, digdug_sharedram_w },
  199.     { 0xa000, 0xa00f, digdug_vh_latch_w },
  200.     { -1 }    /* end of table */
  201. };
  202.  
  203. static struct MemoryWriteAddress writemem_cpu3[] =
  204. {
  205.     { 0x0000, 0x0fff, MWA_ROM },
  206.     { 0x6800, 0x681f, pengo_sound_w, &pengo_soundregs },
  207.     { 0x6822, 0x6822, digdug_interrupt_enable_3_w },
  208.     { 0x8000, 0x9fff, digdug_sharedram_w },
  209.     { -1 }    /* end of table */
  210. };
  211.  
  212.  
  213. /* input from the outside world */
  214. INPUT_PORTS_START( digdug )
  215.     PORT_START    /* DSW0 */
  216.     PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coin_B ) )
  217.     PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
  218.     PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
  219.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
  220.     PORT_DIPSETTING(    0x05, DEF_STR( 2C_3C ) )
  221.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
  222.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  223.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_6C ) )
  224.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_7C ) )
  225.     /* TODO: bonus scores are different for 5 lives */
  226.     PORT_DIPNAME( 0x38, 0x18, DEF_STR( Bonus_Life ) )
  227.     PORT_DIPSETTING(    0x20, "10k 40k 40k" )
  228.     PORT_DIPSETTING(    0x10, "10k 50k 50k" )
  229.     PORT_DIPSETTING(    0x30, "20k 60k 60k" )
  230.     PORT_DIPSETTING(    0x08, "20k 70k 70k" )
  231.     PORT_DIPSETTING(    0x28, "10k 40k" )
  232.     PORT_DIPSETTING(    0x18, "20k 60k" )
  233.     PORT_DIPSETTING(    0x38, "10k" )
  234.     PORT_DIPSETTING(    0x00, "None" )
  235.     PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Lives ) )
  236.     PORT_DIPSETTING(    0x00, "1" )
  237.     PORT_DIPSETTING(    0x40, "2" )
  238.     PORT_DIPSETTING(    0x80, "3" )
  239.     PORT_DIPSETTING(    0xc0, "5" )
  240.  
  241.     PORT_START    /* DSW1 */
  242.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) )
  243.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  244.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  245.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )
  246.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  247.     PORT_DIPNAME( 0x20, 0x20, "Freeze" )
  248.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  249.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  250.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
  251.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  252.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  253.     PORT_DIPNAME( 0x08, 0x00, "Allow Continue" )
  254.     PORT_DIPSETTING(    0x08, DEF_STR( No ) )
  255.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  256.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) )
  257.     PORT_DIPSETTING(    0x04, DEF_STR( Upright ) )
  258.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  259.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
  260.     PORT_DIPSETTING(    0x00, "Easy" )
  261.     PORT_DIPSETTING(    0x02, "Medium" )
  262.     PORT_DIPSETTING(    0x01, "Hard" )
  263.     PORT_DIPSETTING(    0x03, "Hardest" )
  264.  
  265.     PORT_START    /* FAKE */
  266.     /* The player inputs are not memory mapped, they are handled by an I/O chip. */
  267.     /* These fake input ports are read by digdug_customio_data_r() */
  268.         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  269.         PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  270.         PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  271.         PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  272.         PORT_BIT_IMPULSE( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1, 1 )
  273.         PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_BUTTON1, 0, IP_KEY_PREVIOUS, IP_JOY_PREVIOUS )
  274.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
  275.  
  276.     PORT_START    /* FAKE */
  277.         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  278.         PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  279.         PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  280.         PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  281.         PORT_BIT_IMPULSE( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL, 1 )
  282.         PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL, 0, IP_KEY_PREVIOUS, IP_JOY_PREVIOUS )
  283.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
  284.  
  285.     PORT_START    /* FAKE */
  286.     PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_LOW, IPT_COIN1, 1 )
  287.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_LOW, IPT_COIN2, 1 )
  288.     PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
  289.     PORT_BIT_IMPULSE( 0x10, IP_ACTIVE_LOW, IPT_START1, 1 )
  290.     PORT_BIT_IMPULSE( 0x20, IP_ACTIVE_LOW, IPT_START2, 1 )
  291.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  292.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  293. INPUT_PORTS_END
  294.  
  295. static struct GfxLayout charlayout1 =
  296. {
  297.     8,8,    /* 8*8 characters */
  298.     128,    /* 128 characters */
  299.     1,        /* 1 bit per pixel */
  300.     { 0 },    /* one bitplane */
  301.     { 7, 6, 5, 4, 3, 2, 1, 0 },
  302.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  303.     8*8    /* every char takes 8 consecutive bytes */
  304. };
  305.  
  306. static struct GfxLayout charlayout2 =
  307. {
  308.     8,8,    /* 8*8 characters */
  309.     256,    /* 256 characters */
  310.     2,    /* 2 bits per pixel */
  311.     { 0, 4 },      /* the two bitplanes for 4 pixels are packed into one byte */
  312.     { 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 },   /* bits are packed in groups of four */
  313.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },   /* characters are rotated 90 degrees */
  314.     16*8           /* every char takes 16 bytes */
  315. };
  316.  
  317. static struct GfxLayout spritelayout =
  318. {
  319.     16,16,            /* 16*16 sprites */
  320.     256,            /* 256 sprites */
  321.     2,            /* 2 bits per pixel */
  322.     { 0, 4 },    /* the two bitplanes for 4 pixels are packed into one byte */
  323.     { 0, 1, 2, 3, 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
  324.             24*8+0, 24*8+1, 24*8+2, 24*8+3 },
  325.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  326.             32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
  327.     64*8    /* every sprite takes 64 bytes */
  328. };
  329.  
  330.  
  331. static struct GfxDecodeInfo gfxdecodeinfo[] =
  332. {
  333.     { REGION_GFX1, 0, &charlayout1,            0,  8 },
  334.     { REGION_GFX2, 0, &spritelayout,         8*2, 64 },
  335.     { REGION_GFX3, 0, &charlayout2,   64*4 + 8*2, 64 },
  336.     { -1 } /* end of array */
  337. };
  338.  
  339.  
  340. static struct namco_interface namco_interface =
  341. {
  342.     3072000/32,    /* sample rate */
  343.     3,            /* number of voices */
  344.     100,        /* playback volume */
  345.     REGION_SOUND1    /* memory region */
  346. };
  347.  
  348.  
  349.  
  350. static struct MachineDriver machine_driver_digdug =
  351. {
  352.     /* basic machine hardware */
  353.     {
  354.         {
  355.             CPU_Z80,
  356.             3125000,    /* 3.125 Mhz */
  357.             readmem_cpu1,writemem_cpu1,0,0,
  358.             digdug_interrupt_1,1
  359.         },
  360.         {
  361.             CPU_Z80,
  362.             3125000,    /* 3.125 Mhz */
  363.             readmem_cpu2,writemem_cpu2,0,0,
  364.             digdug_interrupt_2,1
  365.         },
  366.         {
  367.             CPU_Z80,
  368.             3125000,    /* 3.125 Mhz */
  369.             readmem_cpu3,writemem_cpu3,0,0,
  370.             digdug_interrupt_3,2
  371.         }
  372.     },
  373.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  374.     100,    /* 100 CPU slices per frame - an high value to ensure proper */
  375.             /* synchronization of the CPUs */
  376.     digdig_init_machine,
  377.  
  378.     /* video hardware */
  379.     36*8, 28*8, { 0*8, 36*8-1, 0*8, 28*8-1 },
  380.     gfxdecodeinfo,
  381.     32,8*2+64*4+64*4,
  382.     digdug_vh_convert_color_prom,
  383.  
  384.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  385.     0,
  386.     digdug_vh_start,
  387.     digdug_vh_stop,
  388.     digdug_vh_screenrefresh,
  389.  
  390.     /* sound hardware */
  391.     0,0,0,0,
  392.     {
  393.         {
  394.             SOUND_NAMCO,
  395.             &namco_interface
  396.         }
  397.     }
  398. };
  399.  
  400.  
  401.  
  402.  
  403. /***************************************************************************
  404.  
  405.   Game driver(s)
  406.  
  407. ***************************************************************************/
  408.  
  409. ROM_START( digdug )
  410.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU  */
  411.     ROM_LOAD( "136007.101",   0x0000, 0x1000, 0xb9198079 )
  412.     ROM_LOAD( "136007.102",   0x1000, 0x1000, 0xb2acbe49 )
  413.     ROM_LOAD( "136007.103",   0x2000, 0x1000, 0xd6407b49 )
  414.     ROM_LOAD( "dd1.4b",       0x3000, 0x1000, 0xf4cebc16 )
  415.  
  416.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  417.     ROM_LOAD( "dd1.5b",       0x0000, 0x1000, 0x370ef9b4 )
  418.     ROM_LOAD( "dd1.6b",       0x1000, 0x1000, 0x361eeb71 )
  419.  
  420.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64k for the third CPU  */
  421.     ROM_LOAD( "136007.107",   0x0000, 0x1000, 0xa41bce72 )
  422.  
  423.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  424.     ROM_LOAD( "dd1.9",        0x0000, 0x0800, 0xf14a6fe1 )
  425.  
  426.     ROM_REGION( 0x4000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  427.     ROM_LOAD( "136007.116",   0x0000, 0x1000, 0xe22957c8 )
  428.     ROM_LOAD( "dd1.14",       0x1000, 0x1000, 0x2829ec99 )
  429.     ROM_LOAD( "136007.118",   0x2000, 0x1000, 0x458499e9 )
  430.     ROM_LOAD( "136007.119",   0x3000, 0x1000, 0xc58252a0 )
  431.  
  432.     ROM_REGION( 0x1000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  433.     ROM_LOAD( "dd1.11",       0x0000, 0x1000, 0x7b383983 )
  434.  
  435.     ROM_REGION( 0x1000, REGION_GFX4 ) /* 4k for the playfield graphics */
  436.     ROM_LOAD( "dd1.10b",      0x0000, 0x1000, 0x2cf399c2 )
  437.  
  438.     ROM_REGION( 0x0220, REGION_PROMS )
  439.     ROM_LOAD( "digdug.5n",    0x0000, 0x0020, 0x4cb9da99 )
  440.     ROM_LOAD( "digdug.1c",    0x0020, 0x0100, 0x00c7c419 )
  441.     ROM_LOAD( "digdug.2n",    0x0120, 0x0100, 0xe9b3e08e )
  442.  
  443.     ROM_REGION( 0x0100, REGION_SOUND1 )    /* sound prom */
  444.     ROM_LOAD( "digdug.spr",   0x0000, 0x0100, 0x7a2815b4 )
  445. ROM_END
  446.  
  447. ROM_START( digdugb )
  448.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code for the first CPU  */
  449.     ROM_LOAD( "dd1a.1",       0x0000, 0x1000, 0xa80ec984 )
  450.     ROM_LOAD( "dd1a.2",       0x1000, 0x1000, 0x559f00bd )
  451.     ROM_LOAD( "dd1a.3",       0x2000, 0x1000, 0x8cbc6fe1 )
  452.     ROM_LOAD( "dd1a.4",       0x3000, 0x1000, 0xd066f830 )
  453.  
  454.     ROM_REGION( 0x10000, REGION_CPU2 ) /* 64k for the second CPU */
  455.     ROM_LOAD( "dd1a.5",       0x0000, 0x1000, 0x6687933b )
  456.     ROM_LOAD( "dd1a.6",       0x1000, 0x1000, 0x843d857f )
  457.  
  458.     ROM_REGION( 0x10000, REGION_CPU3 ) /* 64k for the third CPU  */
  459.     ROM_LOAD( "136007.107",   0x0000, 0x1000, 0xa41bce72 )
  460.  
  461.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  462.     ROM_LOAD( "dd1.9",        0x0000, 0x0800, 0xf14a6fe1 )
  463.  
  464.     ROM_REGION( 0x4000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  465.     ROM_LOAD( "136007.116",   0x0000, 0x1000, 0xe22957c8 )
  466.     ROM_LOAD( "dd1.14",       0x1000, 0x1000, 0x2829ec99 )
  467.     ROM_LOAD( "136007.118",   0x2000, 0x1000, 0x458499e9 )
  468.     ROM_LOAD( "136007.119",   0x3000, 0x1000, 0xc58252a0 )
  469.  
  470.     ROM_REGION( 0x1000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  471.     ROM_LOAD( "dd1.11",       0x0000, 0x1000, 0x7b383983 )
  472.  
  473.     ROM_REGION( 0x1000, REGION_GFX4 ) /* 4k for the playfield graphics */
  474.     ROM_LOAD( "dd1.10b",      0x0000, 0x1000, 0x2cf399c2 )
  475.  
  476.     ROM_REGION( 0x0220, REGION_PROMS )
  477.     ROM_LOAD( "digdug.5n",    0x0000, 0x0020, 0x4cb9da99 )
  478.     ROM_LOAD( "digdug.1c",    0x0020, 0x0100, 0x00c7c419 )
  479.     ROM_LOAD( "digdug.2n",    0x0120, 0x0100, 0xe9b3e08e )
  480.  
  481.     ROM_REGION( 0x0100, REGION_SOUND1 )    /* sound prom */
  482.     ROM_LOAD( "digdug.spr",   0x0000, 0x0100, 0x7a2815b4 )
  483. ROM_END
  484.  
  485. ROM_START( digdugat )
  486.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU  */
  487.     ROM_LOAD( "136007.101",   0x0000, 0x1000, 0xb9198079 )
  488.     ROM_LOAD( "136007.102",   0x1000, 0x1000, 0xb2acbe49 )
  489.     ROM_LOAD( "136007.103",   0x2000, 0x1000, 0xd6407b49 )
  490.     ROM_LOAD( "136007.104",   0x3000, 0x1000, 0xb3ad42c3 )
  491.  
  492.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  493.     ROM_LOAD( "136007.105",   0x0000, 0x1000, 0x0a2aef4a )
  494.     ROM_LOAD( "136007.106",   0x1000, 0x1000, 0xa2876d6e )
  495.  
  496.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64k for the third CPU  */
  497.     ROM_LOAD( "136007.107",   0x0000, 0x1000, 0xa41bce72 )
  498.  
  499.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  500.     ROM_LOAD( "136007.108",   0x0000, 0x0800, 0x3d24a3af )
  501.  
  502.     ROM_REGION( 0x4000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  503.     ROM_LOAD( "136007.116",   0x0000, 0x1000, 0xe22957c8 )
  504.     ROM_LOAD( "136007.117",   0x1000, 0x1000, 0xa3bbfd85 )
  505.     ROM_LOAD( "136007.118",   0x2000, 0x1000, 0x458499e9 )
  506.     ROM_LOAD( "136007.119",   0x3000, 0x1000, 0xc58252a0 )
  507.  
  508.     ROM_REGION( 0x1000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  509.     ROM_LOAD( "136007.115",   0x0000, 0x1000, 0x754539be )
  510.  
  511.     ROM_REGION( 0x1000, REGION_GFX4 )    /* 4k for the playfield graphics */
  512.     ROM_LOAD( "136007.114",   0x0000, 0x1000, 0xd6822397 )
  513.  
  514.     ROM_REGION( 0x0220, REGION_PROMS )
  515.     ROM_LOAD( "digdug.5n",    0x0000, 0x0020, 0x4cb9da99 )
  516.     ROM_LOAD( "digdug.1c",    0x0020, 0x0100, 0x00c7c419 )
  517.     ROM_LOAD( "digdug.2n",    0x0120, 0x0100, 0xe9b3e08e )
  518.  
  519.     ROM_REGION( 0x0100, REGION_SOUND1 )    /* sound prom */
  520.     ROM_LOAD( "digdug.spr",   0x0000, 0x0100, 0x7a2815b4 )
  521. ROM_END
  522.  
  523. ROM_START( dzigzag )
  524.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code for the first CPU  */
  525.     ROM_LOAD( "136007.101",   0x0000, 0x1000, 0xb9198079 )
  526.     ROM_LOAD( "136007.102",   0x1000, 0x1000, 0xb2acbe49 )
  527.     ROM_LOAD( "136007.103",   0x2000, 0x1000, 0xd6407b49 )
  528.     ROM_LOAD( "zigzag4",      0x3000, 0x1000, 0xda20d2f6 )
  529.  
  530.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  531.     ROM_LOAD( "zigzag5",      0x0000, 0x2000, 0xf803c748 )
  532.  
  533.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64k for the third CPU  */
  534.     ROM_LOAD( "136007.107",   0x0000, 0x1000, 0xa41bce72 )
  535.  
  536.     ROM_REGION( 0x10000, REGION_CPU4 )    /* 64k for a Z80 which emulates the custom I/O chip (not used) */
  537.     ROM_LOAD( "zigzag7",      0x0000, 0x1000, 0x24c3510c )
  538.  
  539.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  540.     ROM_LOAD( "zigzag8",      0x0000, 0x0800, 0x86120541 )
  541.  
  542.     ROM_REGION( 0x4000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  543.     ROM_LOAD( "136007.116",   0x0000, 0x1000, 0xe22957c8 )
  544.     ROM_LOAD( "zigzag12",     0x1000, 0x1000, 0x386a0956 )
  545.     ROM_LOAD( "zigzag13",     0x2000, 0x1000, 0x69f6e395 )
  546.     ROM_LOAD( "136007.119",   0x3000, 0x1000, 0xc58252a0 )
  547.  
  548.     ROM_REGION( 0x1000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  549.     ROM_LOAD( "dd1.11",       0x0000, 0x1000, 0x7b383983 )
  550.  
  551.     ROM_REGION( 0x1000, REGION_GFX4 ) /* 4k for the playfield graphics */
  552.     ROM_LOAD( "dd1.10b",      0x0000, 0x1000, 0x2cf399c2 )
  553.  
  554.     ROM_REGION( 0x0220, REGION_PROMS )
  555.     ROM_LOAD( "digdug.5n",    0x0000, 0x0020, 0x4cb9da99 )
  556.     ROM_LOAD( "digdug.1c",    0x0020, 0x0100, 0x00c7c419 )
  557.     ROM_LOAD( "digdug.2n",    0x0120, 0x0100, 0xe9b3e08e )
  558.  
  559.     ROM_REGION( 0x0100, REGION_SOUND1 )    /* sound prom */
  560.     ROM_LOAD( "digdug.spr",   0x0000, 0x0100, 0x7a2815b4 )
  561. ROM_END
  562.  
  563.  
  564.  
  565. GAME( 1982, digdug,   0,      digdug, digdug, 0, ROT90, "Namco", "Dig Dug (set 1)" )
  566. GAME( 1982, digdugb,  digdug, digdug, digdug, 0, ROT90, "Namco", "Dig Dug (set 2)" )
  567. GAME( 1982, digdugat, digdug, digdug, digdug, 0, ROT90, "[Namco] (Atari license)", "Dig Dug (Atari)" )
  568. GAME( 1982, dzigzag,  digdug, digdug, digdug, 0, ROT90, "bootleg", "Zig Zag (Dig Dug hardware)" )
  569.